Skip to content

[GSOC 2019]AlphaGAN Matting #2198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: 4.x
Choose a base branch
from
Open

[GSOC 2019]AlphaGAN Matting #2198

wants to merge 5 commits into from

Conversation

Nerdyvedi
Copy link

@Nerdyvedi Nerdyvedi commented Jul 24, 2019

This is the second pull request. First one being #2134 .

This is to add the implementation of AlphaGAN matting,a Generative adversarial method for natural image matting.

Architecture

Generator

A decoder encoder based architecture is used.

There are 2 options for the generator encoder.

a. Resnet50 minus the last 2 layers
b. Resnet50 + ASPP module

The implementation of decoder is based on the implementation decoder architecture used in Deep image matting paper.

Discriminator

The discriminator used here is the PatchGAN discriminator. The implementation here is inspired from the implementation of CycleGAN
from
https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix

@mshabunin mshabunin added the GSoC label Jul 26, 2019
@StevenPuttemans
Copy link

It seems your code is filled with trailing whitespaces and OpenCV builds do not allow this.
Have a look here for more info: https://pullrequest.opencv.org/buildbot/builders/precommit-contrib_docs/builds/12645/steps/whitespace%20opencv_contrib/logs/stdio

@StevenPuttemans
Copy link

@Nerdyvedi can you please provide an update on your progress? This PR must contain your final code before end of GSoC for the AlphaGAN part of the project.

@alalek
Copy link
Member

alalek commented Aug 30, 2019

see #2134

@StevenPuttemans
Copy link

StevenPuttemans commented Aug 30, 2019

@alalek I guess you mean we need to clean up this PR according to the suggestions made there?
Or do you want us to physically add the code into a single PR?

Also, these PRs were linked in the GSoC report, might want to keep them around?

@alalek
Copy link
Member

alalek commented Aug 30, 2019

OK, looks like this PR is not a successor of #2134 (like #2241)

@Nerdyvedi Nerdyvedi force-pushed the alphaGAN branch 2 times, most recently from 6ce652c to a2ecd75 Compare August 31, 2019 16:52
Update README.md
Add files via upload
Delete epoch132_gt.png
Delete epoch132_img.png
Delete epoch132_pred.png
Add files via upload
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Delete image_pool.py
Delete network.py
Delete train.py
Delete base_options.py
Delete train_options.py
Delete pred6.png
Delete epoch138_pred.png
Delete epoch132_gt.png
Delete epoch132_img.png
Delete epoch132_pred.png
Delete epoch134_gt.png
Delete epoch134_img.png
Delete epoch134_pred.png
Delete epoch138_gt.png
Delete epoch138_img.png
Delete pred5.png
Delete gt1.png
Delete gt2.png
Delete gt3.png
Delete gt4.png
Delete gt5.png
Delete gt6.png
Delete img1.png
Delete img2.png
Delete img3.png
Delete img4.png
Delete img5.png
Delete img6.png
Delete pred1.png
Delete pred2.png
Delete pred3.png
Delete pred4.png
Delete README.md
Create train.py
Add files via upload
Delete single_dataset.py
Add files via upload
Delete test_model.py
Add files via upload
Update README.md
Update networks.py
Delete deeplabv3.py
Update custom_dataset_dataloader.py
Create README.md
Update README.md
Update custom_dataset_dataloader.py
Update models.py
Update custom_dataset_dataloader.py
Update test.py
Update test.py
Update test.py
Rename modules/ximgproc/src/alphagan_matting/utils/image_pool.py to modules/ximgproc/src/alphagan_matting/util/image_pool.py
Rename modules/ximgproc/src/alphagan_matting/utils/utils.py to modules/ximgproc/src/alphagan_matting/util/util.py
Update networks.py
Update test_dataset.py
Add files via upload
Add files via upload
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update README.md
Update base_data_loader.py
Removing whitespaces
Removing whitespaces
Removing whitespaces
Removing whitespaces
Removing whitespaces
Removing whitespaces
Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Missing license headers in Python code. Adopt from here.

  2. modules/ximgproc/src directory is not intended for Python code. This directory should contain compiled code only.

Move all related code:

-modules/ximgproc/src/alphagan_matting
+modules/ximgproc/misc/alphagan_matting
or
+modules/ximgproc/tools/alphagan_matting
  1. Python based-code requires pytorch. This external dependency should be documented in README.md or pip-based requirements.txt should be created with mentioning of working Pytorch version.

## Results

#### Input:
![input](https://raw.githubusercontent.com/Nerdyvedi/GSOC-Opencv-matting/master/2.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are documentation images are stored outside?

from __future__ import print_function
import torch
import numpy as np
from PIL import Image
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does cv.imread() not work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants